import { stringify } from 'qs';
import request from '@/utils/request';

export async function catelist(params) {
  return request(`/api/admin/cate/list?${stringify(params)}`, {
    method: 'get',
  });
}

export async function catedel(params) {
  return request(`/api/admin/cate/del`, {
    method: 'POST',
    body: {
      id: params.id,
    },
  });
}

export async function cate_remove(params) {
  return request('/api/admin/cate/remove', {
    method: 'POST',
    body: {
      key: params.key,
      name: params.name,
    },
  });
}

export async function cate_add(params) {
  return request('/api/admin/cate/add', {
    method: 'POST',
    body: {
      name: params.name,
      c_id: params.c_id,
    },
  });
}
